﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddScore.aspx.cs" Inherits="LabMS.Web.AddScore" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>实验成绩录入</title>
    <link type="text/css" rel="stylesheet" href="../style/screen.css" />
    <!--[if lte IE 6]>
    <link type="text/css" rel="stylesheet" href="../style/ie6.css" />
    <![endif]-->
    <!--[if lte IE 7]>
    <link type="text/css" rel="stylesheet" href="../style/ie7.css" />
    <![endif]-->
<script type="text/javascript" language="javascript">
function NumberText(e,objinput)
{
    if(window.event)
    {
        
        if((e.keyCode<48 || e.keyCode>57) && e.keyCode!=8 && e.keyCode != 37 && e.keyCode != 39 && e.keyCode != 46 )
        {
            return false;
        }
        else
        {
            if(objinput.value>10)
                {
                     return false;
                }
            else if(objinput.value==10)
             {
                 if(e.keyCode!=48)
                 {
                     return false;
                 }
             } 
            return true;
        }
    }
    else if(e.which)
    { 
        if(((e.which>47)   &&   (e.which<58)) || e.which==8 || e.which==46 || e.which==37 || e.which==39)
        {
            if(objinput.value>10 && e.which!=37 && e.which!=46 && e.which!=39 && e.which!=8)
                {
                     return false;
                }
             else if(objinput.value==10 && e.which!=37 && e.which!=46 && e.which!=39 && e.which!=8)
             {
                 if(e.which!=48)
                 {
                     return false;
                 }
             } 
            return true;
        }
        else 
        {
            return false;
        }
    }
}
</script>
</head>
<body class="mainBody">
    <form id="form1" runat="server">
        <div class="main">
            <div id="pageInfo" class="clearfix">
                <div class="title">
                    <label>实验课程成绩信息</label>
                </div>
            </div>
        </div>
    <div class="main">
    <asp:Label ID="ERRLbl" runat="server" Visible="false"></asp:Label>
    <table>
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            课程号：
                        </td>
                        <td>
                            <asp:TextBox ID="CourseCodeTBX" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            课程名称：
                        </td>
                        <td>
                            <asp:TextBox ID="CourseNameTBX" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            隶属专业：
                        </td>
                        <td>
                            <asp:TextBox ID="ProjectName" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            实验学时：
                        </td>
                        <td>
                            <asp:TextBox ID="ExprientHouseTBX" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            授课教师：
                        </td>
                        <td>
                            <asp:TextBox ID="TeacherTBX" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            实验总人数：
                        </td>
                        <td>
                            <asp:TextBox ID="SumTBX" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            班级：
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="ClassTBX" runat="server" TextMode="MultiLine" Rows="2" Width="100%"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <br />
        <tr>
            <td>
                <table>
                    <tr>
                        <td colspan="5">
                            <asp:Button ID="SaveBtn" runat="server" CssClass="button" Text="保存" OnClick="Save_OnClick" />
                            <asp:Button ID="ConcelBtn" runat="server" CssClass="button" Text="取消" OnClick="Concel_OnClick" />&nbsp;
                            总成绩权值：预习成绩占：
                            <asp:TextBox ID="PreTBX" Width="20px" runat="server" onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>%
                            实验成绩占：
                            <asp:TextBox ID="ExTBX" Width="20px" runat="server" onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>%
                            操作成绩占：
                            <asp:TextBox ID="OpTBX" Width="20px" runat="server" onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>%
                            <%--计算方法：
                            <asp:DropDownList ID="MothodDDL" runat="server">
                            <asp:ListItem Value="0">
                                各成绩简单相加
                            </asp:ListItem>
                            <asp:ListItem Value="1">
                                乘以权值再相加
                            </asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="CreatBtn" runat="server" Text="自动生成成绩" CssClass="button" OnClick="CreatScore_OnClick" />
                            <asp:Label ID="MessLbl" runat="server" Visible="false"></asp:Label>--%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            实验项目：
                        </td>
                        <td>
                            <asp:DropDownList ID="SubjectDDL" runat="server" DataTextField="Project_Name" DataValueField="ID" AutoPostBack="true" OnSelectedIndexChanged="DropDownList_OnSelectIndexChange">
                            </asp:DropDownList>
                        </td>
                        <td>
                            班级：
                        </td>
                        <td>
                            <asp:DropDownList ID="ClassDDL" runat="server" DataTextField="ClassItem_Name" DataValueField="ClassID" AutoPostBack="true" OnSelectedIndexChanged="DropDownList_OnSelectIndexChange">
                            </asp:DropDownList>
                        </td>
                        <td>
                         <%--总成绩权值：预习成绩占：
                            <asp:TextBox ID="PreTBX" Width="15px" runat="server" onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>%
                            实验成绩占：
                            <asp:TextBox ID="ExTBX" Width="15px" runat="server" onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>%
                            操作成绩占：
                            <asp:TextBox ID="OpTBX" Width="15px" runat="server" onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>%--%>
                            计算方法：
                            <asp:DropDownList ID="MothodDDL" runat="server">
                            <asp:ListItem Value="0">
                                各成绩简单相加
                            </asp:ListItem>
                            <asp:ListItem Value="1">
                                乘以权值再相加
                            </asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="CreatBtn" runat="server" Text="自动生成成绩" CssClass="button" OnClick="CreatScore_OnClick" />
                            <asp:Label ID="MessLbl" runat="server" Visible="false"></asp:Label>
                       </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="ScoreGridView" CssClass="infoTable" OnPageIndexChanging="ScoreGV_OnPageIndexChang" AutoGenerateColumns="false" DataKeyNames="ID,StudentID" AllowPaging="true" PageSize="20" runat="server" Width="100%">
                <Columns>
                    <asp:BoundField DataField="Student_Code" HeaderText="学号" />
                    <asp:BoundField DataField="Student_Name" HeaderText="姓名" />
                    <asp:TemplateField HeaderText="操作成绩">
                        <ItemTemplate>
                            <asp:TextBox ID="OpScoreTBX" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Score_Op")%>' onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="预习成绩">
                        <ItemTemplate>
                            <asp:TextBox ID="PreScoreTBX" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Score_Pre")%>' onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="实验成绩">
                        <ItemTemplate>
                            <asp:TextBox ID="ExScoreTBX" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Score_Ex")%>' onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="总成绩">
                        <ItemTemplate>
                            <asp:TextBox ID="ScoreTBX" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "MScore")%>' onkeypress="javascript:return NumberText(event,this);" onpaste="return false"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    暂无信息
                </EmptyDataTemplate>
                <HeaderStyle CssClass="header" />
                </asp:GridView>
            </td>
        </tr>
    </table>
    </div>
    <asp:HiddenField ID="IDHF" Value="0" runat="server" />
    </form>
</body>
</html>
